package com.example.demo1107.demo1;

public class Singleton02 {
    private Singleton02(){}
    private static Singleton02 singleton;
    public static Singleton02 getInstance(){
        synchronized (Singleton02.class){
        if (singleton==null){
            singleton = new Singleton02();
        }
        return singleton;
    }
    }
    public void show(){
        System.out.println("-----------show---------");
    }
}
